<? $this->view('admin/helper/filter/mailinglist_filter'); ?>
<div class="row-fluid">
    <div class="span12">
        <div id="pagination" class="btn-group"><?= $pagination ?></div>
    </div>
</div>
<form action="<?= base_url() ?><?= get_segment(1) ?>/<?= get_segment(2) ?>/all" method="post" style="margin-bottom: 5px;" />
<div class="row-fluid">
    <div class="span12">
        <div  class="box corner-all">
            <div class="box-header grd-white corner-top"> <?=lang('label_browser')?> [<?= get_segment(4) + $limit ?>/<?= $count ?>] 
                <span class="pull-right">
                    <a href="<?= base_url() ?><?= get_segment(1) ?>/<?= get_segment(2) ?>/csv/?<?=uri_get()?>" style="width: 16px;height: 16px;margin: 8px;display: block;" class="icon icon-csv"></a>
                </span>
            </div>
            <div id='data_contant'>
                <table class="table">
                    <thead>
                        <tr>
                            <th><input type="checkbox" id="checkall" name="all"></th>
                            <th><?=lang('label_email')?></th>
                            <th><?=lang('label_user_update')?></th>
                            <th><?=lang('label_created_date')?></th>
                            <th><?=lang('label_last_update')?></th>
                            <th><?=lang('label_tool')?></th>
                        </tr>
                    </thead>
                    <tbody>
                    <?
                    foreach ($result as $value) {
                        $user_add = get_userdata_with_id($value->user_update, '*');
                        ?>
                            <tr class="gradeA">
                                <td><input type="checkbox" class="checkall" value="<?= $value->id ?>" name="id[]"></td>
                                <td class="w300">
                                   <?= $value->email ?>
                                </td>
                                <td>
                                    <?
                                    if ($user_add['id']) {
                                        ?>
                                        <a href='<?= base_url() . ADMIN_FOLDER ?>/users/view/<?= $user_add['id'] ?>'><?= $user_add['username'] ?></a></td>
                                    <?
                                } else {
                                    ?>
                                    -----
                                    <?
                                }
                                ?>
                                <td><?= timespan($value->create_date, time()) ?></td>
                                <td><?= timespan($value->update_date, time()) ?></td>
                                <td class="center">
                                    <div class="btn-group">
                                        <button class="btn dropdown-toggle" data-toggle="dropdown"><i class="icon-cog"></i>  <?=lang('label_operation')?> <span class="caret"></span></button>
                                        <ul class="dropdown-menu">
                                            <?
                                            if ($value->mode == 'admin' || $value->mode == 'manager') {
                                                ?>
                                                <li><a    href="<?= base_url() . ADMIN_FOLDER ?>/<?= get_segment(2) ?>/report/<?= $value->id ?>"><i class="icon-paste"></i>  <?=lang('label_user_report')?></a></li>
                                                <?
                                            }
                                            ?>
                                            <li><a    href="<?= base_url() . ADMIN_FOLDER ?>/<?= get_segment(2) ?>/edit/<?= $value->id ?>"><i class="icon-edit"></i>  <?=lang('label_edit')?></a></li>
                                            <li><a  class="delete_confirm " href="<?= base_url() . ADMIN_FOLDER ?>/<?= get_segment(2) ?>/delete/<?= $value->id ?>"><i  class="icon-trash"></i> <?=lang('label_delete')?></a></li>
                                        </ul>
                                    </div>

                                </td>
                            </tr>
                        <? } ?>
                    </tbody>
                </table>
            </div>
            <div class="footer_tool_box">
                <select class="droop_tool_box" name='doaction'>
                    <option value=""><?=lang('label_choose_fromlist')?></option>
                    <option value="delete"><?=lang('label_delete')?></option>
                </select>
                <button class="btn btn-primary" id='execution' type="submit"><?=lang('label_execution')?></button>
            </div>
        </div>
    </div>
</div>

</form>
<div class="row-fluid">
    <div class="span12">
        <div id="pagination" class="btn-group"><?= $pagination ?></div>
    </div>
</div>


